/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.hitechbangla.fctu.utility;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.geom.Arc2D;
import java.util.Random;
import javax.swing.JApplet;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;

/**
 *
 * @author Asus
 */
public class NewClass extends JPanel {

    final static BasicStroke wideStroke = new BasicStroke(24.0f);

    public void paint(Graphics g) {
	Graphics2D g2 = (Graphics2D) g;
	g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
		RenderingHints.VALUE_ANTIALIAS_ON);

	g2.setPaint(Color.BLACK);
	int x = 20;
	int y = 20;

	g2.setStroke(wideStroke);
	for(int i=0;i<1;i++)
	{
	    g2.draw(new Arc2D.Double(x, y, 200, 200, 90, 90,Arc2D.OPEN));
	    g2.draw(new Arc2D.Double(x, y, 200, 200, 270, 90,Arc2D.OPEN));
	    
	    x+=40;y+=40;
	    g2.draw(new Arc2D.Double(x, y, 120, 120, 90, 90,Arc2D.OPEN));
	}
	//g2.drawString("Arc2D", x, 250);
    }

    public static void main(String args[]) {
//	for (int i = 0; i < 100; i++) {
//	    int start = 1, end = 5;
//	    int randomNumber;
//	    Random random = new Random();
//	    randomNumber = GeneralUtil.getRandomIntegerInRange(start, end, random);
//	    System.out.println(randomNumber);
//	}
//	double degree = 45;
//	float deg = 42;
//	if(degree > deg)
//	{
//	    System.out.println("double gt float");
//	}
//	System.out.println("Degree and Rad :"+degree+" : "+Math.toRadians(degree));
//	System.out.println(Math.tan(degree)+" "+Math.tan( Math.toRadians(degree) ));
//	double e = Math.toDegrees( Math.atan(1) );
//	System.out.println("Degree and Rad2 : "+ Math.atan(1)+" "+Math.toDegrees( Math.atan(1) ));
	//System.out.println("Inverse tan of 1 : "+Math.atan(rad));
	
//	int a[][];
//	a = new int[3][];
//	a[0] = new int[5];
//	a[1] = new int[2];
//	a[2] = new int[4];
//	
//	for(int i=0; i<a.length;i++)
//	{
//	    for(int j=0;j<a[i].length;j++)
//	    {
//		a[i][j] = j + 2;
//	    }
//	}
//	for(int i=0; i<a.length;i++)
//	{
//	    for(int j=0;j<a[i].length;j++)
//	    {
//		System.out.print( a[i][j]+" ");
//	    }
//	    System.out.println();
//	}
//	JFrame window = new JFrame();
//    window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//    window.setBounds(30, 30, 300, 300);
//    window.getContentPane().add(new MyCanvas());
//    window.setVisible(true);
	JFrame f = new JFrame("");
	f.addWindowListener(new WindowAdapter() {
	    public void windowClosing(WindowEvent e) {
		System.exit(0);
	    }
	} );
	JPanel applet = new NewClass();
	f.getContentPane().add("Center", applet);
	f.pack();
	f.setSize(new Dimension(300, 300));
	f.setVisible(true);
    }
}

//class MyCanvas extends JComponent {
//
//  public void paint(Graphics g) {
////    g.drawArc (10, 10, 100, 100,90,-20);   
////    g.drawArc (10, 20, 100, 100,90,-20);  
////    g.drawArc (10+30, 10, 100, 100,90,-20);   
////    g.drawArc (10+30, 20, 100, 100,90,-20); 
//      
//      int y = 2;
//    for(int i = 0;i<8;i++)
//    {
//	int x = 2;
//	for(int j=0;j<8;j++)
//	{
//	    g.drawArc (x, y, 50, 60,90,-30);  
//	    x+=20;
//	    //g.drawArc(i, i, i, i, i, i);
//	}
//	y+=20;
//    }
//  }
//}
